<template>
  <!-- 应急资源 / 电缆隧道监测 -->
  <div class="Emergency">
    <div class="flex location-wrap">
      <span class="white">当前位置：</span>
      <el-breadcrumb separator="/">
        <el-breadcrumb-item :to="{ path: '/EDManagement' }">应急资源</el-breadcrumb-item>
        <el-breadcrumb-item style="font-size: 16px;">电缆隧道监测</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="box">
      <div class="left">
        <div class="select_city">地区选择</div>
        <div class="content">
          <!-- <div class="item" v-for="(item) in cityData" :key="item.id">{{ item.name }}</div> -->
          <div class="item" :class="item.id == cityId ? 'checkStyle' : ''" v-for="(item) in cityData" :key="item.id" @click="checkCity(item.id)">{{ item.name }}</div>
        </div>
      </div>
      <div class="right">
        <div class="top">
          <div class="select_city">电缆隧道</div>
          <div class="content_box" v-if="cityId ==0">
            <div class="item" v-for="(item,index) in quansheng" :key="index"><span class="quan"></span>{{ item.name }}</div>
          </div>
          <div class="content_box" v-else-if="cityId ==1">
            <div class="item" v-for="(item,index) in wuhan" :key="index"><span class="quan"></span>{{ item.name }}</div>
          </div>
          <div class="content_box" v-else-if="cityId ==2">
            <div class="item" v-for="(item,index) in jingzhou" :key="index"><span class="quan"></span>{{ item.name }}</div>
          </div>
          <div class="content_box" v-else>
            <div class="item" style="margin-top: 100px;font-size: 16px;">
              暂无数据
            </div>
          </div>
        </div>
        <div class="bottom" v-if="cityId ==0">
          <div class="select_city">电缆隧道详情</div>
          <div class="title_name">A电缆隧道</div>
          <div class="content">
            <div class="left_one">
              <div class="img"><img src="@/assets/img/wendu.png" alt="" /></div>
              <div>
                温度：<span class="sheshidu">70℃</span>
              </div>
            </div>
            <div class="right_two">
              <div class="img"><img src="@/assets/img/wendu1.png" alt="" /></div>
              <div>
                温度：<span class="sheshidu">70℃</span>
              </div>
            </div>
          </div>
        </div>
        <div class="bottom" v-else-if="cityId ==1">
          <div class="select_city">电缆隧道详情</div>
          <div class="title_name">A电缆隧道</div>
          <div class="content">
            <div class="left_one">
              <div class="img"><img src="@/assets/img/wendu.png" alt="" /></div>
              <div>
                温度：<span class="sheshidu">65℃</span>
              </div>
            </div>
            <div class="right_two">
              <div class="img"><img src="@/assets/img/wendu1.png" alt="" /></div>
              <div>
                温度：<span class="sheshidu">65℃</span>
              </div>
            </div>
          </div>
        </div>
        <div class="bottom" v-else-if="cityId ==2">
          <div class="select_city">电缆隧道详情</div>
          <div class="title_name">A电缆隧道</div>
          <div class="content">
            <div class="left_one">
              <div class="img"><img src="@/assets/img/wendu.png" alt="" /></div>
              <div>
                温度：<span class="sheshidu">75℃</span>
              </div>
            </div>
            <div class="right_two">
              <div class="img"><img src="@/assets/img/wendu1.png" alt="" /></div>
              <div>
                温度：<span class="sheshidu">75℃</span>
              </div>
            </div>
          </div>
        </div>
        <div class="bottom" v-else-if="cityId ==3">
          <div class="select_city">电缆隧道详情</div>
          <div class="title_name">A电缆隧道</div>
          <div class="content">
            <div class="left_one">
              <div class="img"><img src="@/assets/img/wendu.png" alt="" /></div>
              <div>
                温度：<span class="sheshidu">60℃</span>
              </div>
            </div>
            <div class="right_two">
              <div class="img"><img src="@/assets/img/wendu1.png" alt="" /></div>
              <div>
                温度：<span class="sheshidu">75℃</span>
              </div>
            </div>
          </div>
        </div>
        <div class="bottom" v-else>
          <div class="select_city">电缆隧道详情</div>
          <div style="text-align: center;margin-top: 20px; font-size: 16px;">暂无数据</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>

// import { homePageSelete } from "@/api/EmergencyDisposal/zqbs.js";

import "@/assets/style/Emergency.less";
// import Axios from "axios";
export default {
  name: "CableTunnelMonitoring",
  components: {},
  data() {
    return {
      cityData: [
        {
          name: "全省",
          id: 0
        },
        {
          name: "武汉",
          id: 1
        },
        {
          name: "荆州",
          id: 2
        },
        {
          name: "黄石",
          id: 3
        },
        {
          name: "宜昌",
          id: 4
        },
        {
          name: "襄阳",
          id: 5
        },
        {
          name: "孝感",
          id: 6
        },
        {
          name: "荆门",
          id: 7
        },
        {
          name: "黄冈",
          id: 8
        },
        {
          name: "鄂州",
          id: 9
        },
        {
          name: "咸宁",
          id: 10
        },
        {
          name: "十堰",
          id: 11
        },
        {
          name: "随州",
          id: 12
        },
        {
          name: "恩施",
          id: 13
        },
        {
          name: "神龙架",
          id: 14
        }
      ],
      quansheng: [
        {
          name: "友谊大道电缆隧道"
        },
        {
          name: "青菱电缆隧道"
        },
        {
          name: "赵家条电缆隧道"
        },
        {
          name: "滨河路电缆隧道"
        },
        {
          name: "夹套河路电缆隧道"
        },
        {
          name: "荆州过江电缆隧道"
        }
      ],
      wuhan: [
        {
          name: "友谊大道电缆隧道"
        },
        {
          name: "青菱电缆隧道"
        },
        {
          name: "赵家条电缆隧道"
        },
        {
          name: "滨河路电缆隧道"
        }
      ],
      jingzhou: [
        {
          name: "夹套河路电缆隧道"
        },
        {
          name: "荆州过江电缆隧道"
        }
      ],
      cityId: 0
    };
  },
  mounted() {

  },
  methods: {
    checkCity(val) {
      console.log(val);
      this.cityId = val;
      // this.arr = this.arr.sort(() => Math.random() - 0.5);
    }
  }
};
</script>

<style scoped lang="less">
@import "../../../assets/style/DisasterInformation.less";
.box {
  width: 98vw;
  height: 78vh;
  // border: 1px solid red;
  margin-top: 10px;
  display: flex;
  // justify-content: space-around;
  color: #fff;
  .left {
    width: 30%;
    height: 100%;
    border: 1px solid #0649d7;

    .content {
      width: 100%;
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-start; /* 替代space-between布局方式 */
      text-align: center;
      justify-content: center !important;
    }

    .item {
      flex: 1;
      height: 25px;
      // background-color: #cacaca;
      /* 间隙为5px */
      margin: 0 10px 10px 0;
      /* END */
      /* 这里的10px = (分布个数3-1)*间隙5px, 可以根据实际的分布个数和间隙区调整 */
      width: calc((100% - 12px) / 6);
      /* END */
      /* 加入这两个后每个item的宽度就生效了 */
      min-width: calc((100% - 12px) / 6);
      max-width: calc((100% - 12px) / 6);
      /* END */
    }
    .item:nth-child(5n) {
      /* 去除第3n个的margin-right */
      margin-right: 0;
    }
  }
  .right {
    margin-left: 10px;
    width: 70%;
    height: 100%;
    .top {
      width: 100%;
      height: 78%;
      border: 1px solid #0649d7;
      .content_box {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start; /* 替代space-between布局方式 */
        text-align: center;
        justify-content: center !important;
      }
      .item {
        flex: 1;
        height: 25px;
        // background-color: #cacaca;
        /* 间隙为5px */
        margin: 0 10px 10px 0;
        /* END */
        /* 这里的10px = (分布个数3-1)*间隙5px, 可以根据实际的分布个数和间隙区调整 */
        width: calc((100% - 12px) / 7);
        /* END */
        /* 加入这两个后每个item的宽度就生效了 */
        min-width: calc((100% - 12px) / 7);
        max-width: calc((100% - 12px) / 7);
        /* END */
        .quan {
          display: inline-block;
          width: 14px;
          height: 14px;
          line-height: 14px;
          background: #98ef0c;
          border-radius: 50%;
          margin-right: 6px;
        }
      }
      .item:nth-child(6n) {
        /* 去除第3n个的margin-right */
        margin-right: 0;
      }
    }
    .bottom {
      margin-top: 10px;
      width: 100%;
      height: 20%;
      border: 1px solid #0649d7;
      .title_name {
        color: #fff;
        font-size: 18px;
        font-weight: bold;
        text-align: center;
      }
      .content {
        display: flex;
        > div {
          flex: 1;
        }
        .left_one,
        .right_two {
          text-align: center;
          font-size: 16px;
          font-weight: bold;
          display: flex;
          align-items: center;
          justify-content: center;
          .img {
            margin-right: 8px;
            img {
              width: 50px;
              height: 50px;
            }
          }

          .sheshidu {
            color: #ec808d;
          }
        }
      }
    }
  }
}

.select_city {
  background: rgba(38, 92, 255, 0.45);
  height: 30px;
  line-height: 30px;
  padding-left: 10px;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 15px;
}
.checkStyle {
  border-radius: 10px;
  border: 1px solid #0649d7;
  color: #ffff00;
  box-sizing: border-box;
}
</style>
